/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sdc.strategy.allocation;

import java.util.LinkedList;
import java.util.List;
import sdc.component.type.ComponentType;
import sdc.net.server.comp.ComponentServer;
import sdc.net.server.comp.ComponentServerManager;


/**
 *
 * @author yokoe
 */
public class RandomAllocateStrategy extends AllocateStrategy{

	@Override
	public List<ComponentServer> allocateComponents(ComponentType componentType, int duplicateNum) {

		List<ComponentServer> servers = new LinkedList<ComponentServer>();

		for(ComponentServer componentServer : ComponentServerManager.INSTANCE.getShuffledList(duplicateNum))
		{
			allocateComponentToServer(componentServer, componentType);

			servers.add(componentServer);
		}

		return servers;
	}
}
